//
//  ShellNetworkCalculateViewModel.m
//  ShellWallert
//
//  Created by lvzhao on 2019/10/3.
//  Copyright © 2019 VV. All rights reserved.
//

#import "ShellNetworkCalculateViewModel.h"
#import "ShellCalculateModel.h"

@implementation ShellNetworkCalculateViewModel
/**
 Convert 获取全网数据
 */
- (void)queryNetworkHashRateList{
    
    
    @weakify(self);
    [LZNetworkingManager lz_request:@"get" url:kNetworkHashRate params:nil success:^(id  _Nullable responseObject) {
        if([responseObject[kResultStatus] isEqualToString:kCode]){
            @strongify(self);
            NSDictionary *dataDictionary = responseObject[kResultData];
            self.descText = dataDictionary[@"descText"];
            NSArray *dataArray = dataDictionary[@"data"];
            for (int i = 0; i < dataArray.count; i++) {
                ShellCalculateModel *calculateModel = [ShellCalculateModel mj_objectWithKeyValues:dataArray[i]];
                [self.dataArray addObject:calculateModel];
            }
            [self.reloadSubject sendNext:@(1)];
        }
    } failure:^(NSError * _Nullable error) {} notwork:^(NSError * _Nullable error) {} isLoading:YES isFailTip:YES];
     
    
    
}
@end
